package com.yunqing.restkeeper.enterprise.web.controller.store;

import com.yunqing.restkeeper.store.api.entity.Staff;
import com.yunqing.restkeeper.store.api.service.IStaffService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.extern.slf4j.Slf4j;
import org.apache.dubbo.config.annotation.DubboReference;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @ClassName StaffController
 * @Description TODO
 * @author: puyunqing
 * @Date: 2025/7/21
 */
@Slf4j
@Tag(name = "员工管理")
@RestController
@RequestMapping("/staff")
public class StaffController {

    @DubboReference(version = "1.0.0", check=false)
    private IStaffService staffService;

    /**
     * 新增员工
     */
    @Operation(summary = "新增员工")
    @PostMapping(value = "/add")
    public boolean add(@RequestBody Staff staff){
        return staffService.save(staff);
    }

}
